package com.youpai.platform.common.config;

import com.youpai.platform.user.service.handler.UserInfoHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @date: 2021/11/29 23:35
 * @author: Anna
 * @version: 1.0
 * @description: 拦截器类
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Resource
    private UserInfoHandler userInfoHandler;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userInfoHandler).addPathPatterns("/**");
    }
}
